<template>
  <div>
    <mt-header title="应聘信息" style="background-color: #ee9900">
      <div slot="left" title="应聘信息">
        <!--<mt-button icon="back" @click="back">返回</mt-button>-->
      </div>
    </mt-header>
    <h3 style="padding: 3%">|个人信息 </h3>
    <mt-field label="姓名" placeholder="请输入姓名" v-model="employName"></mt-field>

    <mt-field label="性别" placeholder="请选择" v-model="sex" @click.native = "sexType"></mt-field>
    <mt-popup
      v-model="sexVisible"
      position="bottom" style="width: 100%">
      <mt-picker :slots="sexArray" @change="sexChange" valueKey="name"></mt-picker>

    </mt-popup>



    <mt-field label="电话号码" placeholder="请输入电话号码" v-model="phoneNumber"></mt-field>
    <mt-field label="出生日期" type="date" v-model="birthTime"></mt-field>
    <mt-field label="身高" placeholder="请输入身高" v-model="stature"></mt-field>
    <mt-field label="婚姻状况" placeholder="请输入婚姻状况" v-model="maritalStatus"></mt-field>
    <mt-field label="特长" placeholder="请输入特长" v-model="speciality"></mt-field>
    <mt-field label="身份证号码" placeholder="请输入身份证号码" v-model="idNumber"></mt-field>
    <mt-field label="应征岗位" placeholder="请输入应征岗位" v-model="position"></mt-field>
    <mt-field label="待遇需求" placeholder="请输入待遇需求" v-model="salary"></mt-field>
    <mt-field label="引荐人" placeholder="请输入引荐人" v-model="referrer"></mt-field>
    <mt-field label="学历" placeholder="请输入学历" v-model="education"></mt-field>
    <mt-field label="毕业学校" placeholder="请输入毕业学校" v-model="schoolName"></mt-field>
    <mt-field label="专业" placeholder="请输入专业" v-model="profession"></mt-field>
    <mt-field label="学位" placeholder="请输入学位" v-model="graduate"></mt-field>
    <mt-field label="单位名称" placeholder="请输入单位名称" v-model="lastCompany"></mt-field>
    <mt-field label="上份工作入职日期" type="date" v-model="startTime"></mt-field>
    <mt-field label="上份工作离职日期" type="date" v-model="endTime"></mt-field>
    <mt-field label="上份工作岗位" placeholder="请输入上份工作岗位" v-model="lastPosition"></mt-field>
    <mt-field label="上份工作薪资" placeholder="请输入上份工作薪资" v-model="lastSalary"></mt-field>
    <mt-field label="上份工作离职原因" placeholder="请输入上份工作离职原因" v-model="dimissionCause"></mt-field>

    <div>
      <mt-button type="primary" size="large"
                 @click.native="handleClick" style="text-align: center">提交
      </mt-button>
    </div>
    <a-input type="hidden" v-model="sex1"></a-input>
  </div>

</template>

<script>
  import * as mint from 'mint-ui'
  import { postAction } from '@/api/manage'
  import { MessageBox } from 'mint-ui'
  // import  mine from '../index/mine.vue'

  export default {
    name: 'onlineRecruitment',
    components: {
      ...mint
    },
    data() {
      return{
        sexVisible:false,
        sexArray: [{
          values: [{name: '男', value: '1'}, {name: '女', value: '2'}],
          className: 'slot1',
          textAlign: 'center'
        }],
      }
    },

    methods: {
      sexType(){
        this.sexVisible = !this.sexVisible;
      },
     sexChange(picker, values) {
        this.sex1 = values[0].value;
        this.sex = values[0].name;
      },
      handleClick: function() {
        const parameter = {
          employName: this.employName,
          sex: this.sex,
          phoneNumber: this.phoneNumber,
          birthTime: this.birthTime,
          stature: this.stature,
          maritalStatus: this.maritalStatus,
          speciality: this.speciality,
          idNumber: this.idNumber,
          position: this.position,
          salary: this.salary,
          referrer: this.referrer,
          education: this.education,
          schoolName: this.schoolName,
          profession: this.profession,
          graduate: this.graduate,
          lastCompany: this.lastCompany,
          startTime: this.startTime,
          endTime: this.endTime,
          lastPosition: this.lastPosition,
          lastSalary: this.lastSalary,
          dimissionCause: this.dimissionCause
        }
        // const routes = [
        //   { path: '/phone/mine', component: mine }
        // ]
        postAction('/recruitment/recruitmentManage/add', parameter).then((res) => {
          if (res.success) {
            MessageBox('提示', res.message);
            this.$router.push('/phone/mine')
          } else {
            MessageBox('提示', '操作失败!!!')
          }
        })

      }
    },mounted(){
      this.sex1 ='';
      this.sex = '';
    }

  }
</script>
.ant-list-item-content {
display: block;
}
<style scoped>

</style>